if (localApps.length == 0 && otherApps.length == 0)
return false;
- if (!Main.pushModal(this.actor))
- return false;
+ if (!Main.pushModal(this.actor)) {
+ // Probably someone else has a pointer grab, try again with keyboard only
+ if (!Main.pushModal(this.actor, global.get_current_time(), Meta.ModalOptions.POINTER_ALREADY_GRABBED)) {
+ return false;
+ }
+ }
this._haveModal = true;
this._modifierMask = primaryModifier(mask);
* initiated event. If not provided then the value of
* global.get_current_time() is assumed.
*
+ * @options: optional Meta.ModalOptions flags to indicate that the
+ * pointer is alrady grabbed
+ *
* Returns: true iff we successfully acquired a grab or already had one
*/
-function pushModal(actor, timestamp) {
+function pushModal(actor, timestamp, options) {
if (timestamp == undefined)
timestamp = global.get_current_time();
if (modalCount == 0) {
- if (!global.begin_modal(timestamp)) {
+ if (!global.begin_modal(timestamp, options ? options : 0)) {
log('pushModal: invocation of begin_modal failed');
return false;
}
* was previouly called.
*/
gboolean
-shell_global_begin_modal (ShellGlobal *global,
- guint32 timestamp)
+shell_global_begin_modal (ShellGlobal *global,
+ guint32 timestamp,
+ MetaModalOptions options)
{
- return meta_plugin_begin_modal (global->plugin, global->stage_xwindow,
- None, 0, timestamp);
+ return meta_plugin_begin_modal (global->plugin, global->stage_xwindow, None, options, timestamp);
}
/**
/* Input/event handling */
gboolean shell_global_begin_modal (ShellGlobal *global,
- guint32 timestamp);
+ guint32 timestamp,
+ MetaModalOptions options);
void shell_global_end_modal (ShellGlobal *global,
guint32 timestamp);